package com.itheima.demo;

import java.util.*;
import java.util.stream.Collectors;

public class Demo4 {
    public static void main(String[] args) {
        System.out.println("请输入循环次数");
        Scanner sc = new Scanner(System.in);
            int count = sc.nextInt();
        for (int i = 1; i <= count ; i++) {
            getScore();
            System.out.println("==========");
        }

    }

    private static void getScore() {
        //TreeSet<Integer> set = new TreeSet<>();
        ArrayList<Integer> list1 = new ArrayList<>();
        Random r = new Random();
        for (int i = 1; i <= 10 ; i++) {
            list1.add(r.nextInt(100)+1);
        }
        List<Integer> list = list1.stream().skip(1).limit(8).collect(Collectors.toList());
        System.out.println(list);
        int sum= 0;
        for (Integer s : list) {
            sum = sum +s;
        }
        System.out.println(sum / (list.size()));
    }
}
